<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
	'id'=>'member-form',
	'enableAjaxValidation'=>false,
	'htmlOptions' => array('enctype' => 'multipart/form-data')
)); ?>
<?php echo $form->errorSummary(array($member, $membercode, $education)); ?>
	<table class="button-form"><tr>
		<td><span class="note">Thông tin bắt buộc <span class="required">*</span>.</span></td>
		<td align="right">
			<?php if ($member->isNewRecord) :?><?php echo CHtml::submitButton('Căn bản',  array('name' => 'Basic', 'class' => 'button')); ?><?php endif;?>
		</td>
		<td align="right" width="85">
			<div class="row buttons"><?php echo CHtml::submitButton($member->isNewRecord ? 'Đăng kí' : 'Cập nhật'); ?></div>
		</td>
	</tr></table>

	<div class="row">
		<?php echo $form->labelEx($membercode,'courses_id'); ?>
		<?php echo $form->dropDownList($membercode,'courses_id', CHtml::listData(Courses::model()->findAll(array("condition" => "status = '1'")), 'id', 'name')); ?>
		<?php echo $form->error($membercode,'courses_id'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($membercode,'status'); ?>
		<?php echo $form->dropDownList($membercode,'status',Util::itemAlias('CheckType')); ?>
		<?php echo $form->error($membercode,'status'); ?>
	</div>
<!----------------Thông tin cá nhân----------------------------------------------------------------------------------->
    <?php $this->beginWidget('ext.coolfieldset.JCollapsibleFieldset', array(
        'legend'=>'Thông tin cá nhân'
    )); ?>
    <div class="row">
		<?php echo $form->labelEx($member,'fullname'); ?>
			<?php echo $form->textField($member,'fullname',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($member,'fullname'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($member,'cmnd'); ?>
			<?php echo $form->textField($member,'cmnd',array('size'=>60,'maxlength'=>12)); ?>
		<?php echo $form->error($member,'cmnd'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($member,'birthday'); ?>
			<?php echo $form->textField($member,'birthday',array('class'=> 'picker-date')); ?>
		<?php echo $form->error($member,'birthday'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($member,'sex'); ?>
			<?php echo $form->dropDownList($member,'sex', Util::itemAlias('Sex')); ?>
		<?php echo $form->error($member,'sex'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($member,'birthplace'); ?>
			<?php echo $form->textField($member,'birthplace',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($member,'birthplace'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($member,'address'); ?>
			<?php echo $form->textField($member,'address',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($member,'address'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($member,'avatar'); ?>
			<?php echo $form->fileField($member,'avatar',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($member,'avatar'); ?>
	</div>
	<?php $this->endWidget(); ?>

<!----------------Thông tin liên hệ----------------------------------------------------------------------------------->
	<?php $this->beginWidget('ext.coolfieldset.JCollapsibleFieldset', array(
        'legend'=>'Thông tin liên hệ'
    )); ?>
	<div class="row">
		<?php echo $form->labelEx($member,'phone'); ?>
			<?php echo $form->textField($member,'phone',array('size'=>20,'maxlength'=>20, 'class' => 'input-short')); ?>
		<?php echo $form->error($member,'phone'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($member,'cellphone'); ?>
			<?php echo $form->textField($member,'cellphone',array('size'=>20,'maxlength'=>20, 'class' => 'input-short')); ?>
		<?php echo $form->error($member,'cellphone'); ?>
	</div>
 	<div class="row">
		<?php echo $form->labelEx($member,'email'); ?>
			<?php echo $form->textField($member,'email',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($member,'email'); ?>
	</div>
	<div class="row">
		<?php echo $form->labelEx($member,'contact_address'); ?>
			<?php echo $form->textField($member,'contact_address',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($member,'contact_address'); ?>
	</div>
	<?php $this->endWidget(); ?>
<!----------------Thông tin ân nhân----------------------------------------------------------------------------------->
	<?php $this->beginWidget('ext.coolfieldset.JCollapsibleFieldset', array('legend'=>'Thông tin ân nhân')); ?>
	    <div class="row">
			<?php echo $form->labelEx($member,'donor_name'); ?>
				<?php echo $form->textField($member,'donor_name',array('size'=>60,'maxlength'=>128)); ?>
			<?php echo $form->error($member,'donor_name'); ?>
		</div>
	    <div class="row">
			<?php echo $form->labelEx($member,'donor_email'); ?>
				<?php echo $form->textField($member,'donor_email',array('size'=>60,'maxlength'=>128)); ?>
			<?php echo $form->error($member,'donor_email'); ?>
		</div>
		<div class="row">
			<?php echo $form->labelEx($member,'donor_address'); ?>
				<?php echo $form->textField($member,'donor_address',array('size'=>60,'maxlength'=>255)); ?>
			<?php echo $form->error($member,'donor_address'); ?>
		</div>
	<?php $this->endWidget(); ?>
<!----------------Thông tin khóa học----------------------------------------------------------------------------------->
	<?php $this->beginWidget('ext.coolfieldset.JCollapsibleFieldset', array(
        'legend'=>'Thông tin khóa học'
    )); ?>
	<div class="row">
		<?php echo $form->labelEx($education,'school_name'); ?>
			<?php echo $form->textField($education,'school_name',array('size'=>60,'maxlength'=>128)); ?>
		<?php echo $form->error($education,'school_name'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($education,'major'); ?>
			<?php echo $form->textField($education,'major',array('size'=>60,'maxlength'=>255)); ?>
		<?php echo $form->error($education,'major'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($education,'start_year'); ?>
			<?php echo $form->textField($education,'start_year',array('class'=> 'picker-monthyear')); ?>
		<?php echo $form->error($education,'start_year'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($education,'end_year'); ?>
			<?php echo $form->textField($education,'end_year',array('class'=> 'picker-monthyear')); ?>
		<?php echo $form->error($education,'end_year'); ?>
	</div>
	<div class="row">
		<?php $this->widget('SemesterForm', $paramSemesterForm); ?>
	</div>
	<?php $this->endWidget(); ?>

<!----------------Hoạt động xã hội----------------------------------------------------------------------------------->
	<?php $this->beginWidget('ext.coolfieldset.JCollapsibleFieldset', array(
        'legend'=>'Hoạt động xã hội'
    )); ?>
	<div class="row">
		<?php echo $form->labelEx($member,'social_position'); ?>
			<?php echo $form->textArea($member,'social_position',array('rows'=>6, 'cols'=>50, 'style'=>'width:80%')); ?>
		<?php echo $form->error($member,'social_position'); ?>
	</div>

	<div class="row">
		<?php echo $form->labelEx($member,'social_activity'); ?>
			<?php echo $form->textArea($member,'social_activity',array('rows'=>6, 'cols'=>50, 'style'=>'width:80%')); ?>
		<?php echo $form->error($member,'social_activity'); ?>
	</div>

	<?php $this->endWidget(); ?>

	<?php if (!$member->isNewRecord): ?>
        <input type="hidden" name="update_id" value="<?php echo $member->user_id; ?>"/>
	<?php endif; ?>

	<table class="button-form"><tr>
		<td align="right">
			<div class="row buttons"><?php echo CHtml::submitButton($member->isNewRecord ? 'Đăng kí' : 'Cập nhật'); ?></div>
		</td>
	</tr></table>

<?php $this->endWidget(); ?>

</div><!-- form -->